package com.whsm.boot.controller;

import com.whsm.boot.bean.Car;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Slf4j
@Controller
@ComponentScan("com.whsm")
public class HelloController {

    @Autowired
    private Car car;

    @RequestMapping("/hello")
    @ResponseBody
    public String save(){
        log.info("请求进来了");
        return "hello Spring boot2!";
    }

    @RequestMapping("/car")
    @ResponseBody
    public Car save1(){
        return car;
    }
}
